import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useCategoryStore = defineStore(
    'category',
    () => {
        /** 首页点击选择的分类 */
        const selectedCategory = ref<{ id: string }>()

        /** 切换选中的分类 */
        const selectedChange = (val: { id: string }) => {
            selectedCategory.value = val
        }
        return {
            selectedCategory,
            selectedChange
        }
    }
)
